package com.itheima.service.impl;

import com.itheima.dao.CollectionDao;
import com.itheima.domain.Collection2;
import com.itheima.domain.FilePojo;
import com.itheima.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectionServiceImpl implements CollectionService {

    @Autowired
    private CollectionDao collectionDao;
    @Override
    public boolean save(Collection2 collection) {

        return collectionDao.save(collection) > 0;
    }

    @Override
    public boolean delete(Collection2 collection) {
        return collectionDao.delete(collection) > 0;
    }

    @Override
    public Collection2 getById(Integer qid, Integer uid) {
        Collection2 collection2 = collectionDao.getById(qid,uid);

        return collection2;
    }

    @Override
    public List<Collection2> getByUid(Integer uid) {
        List<Collection2> byUid = collectionDao.getByUid(uid);
        return byUid;
    }

    @Override
    public List<Collection2> getAll() {
        List<Collection2> all = collectionDao.getAll();
        return all;
    }
}
